package com.serv.employee;

import com.jfinal.aop.Inject;
import com.jfinal.plugin.activerecord.Page;
import com.serv.common.base.BaseController;
import com.serv.common.model.Employee;
import com.serv.common.model.Merchant;
import com.serv.common.model.sys.User;
import com.serv.common.service.EmployeeService;
import com.serv.common.service.sys.OrganizationService;
import com.serv.common.service.sys.UserService;
import com.serv.util.AjaxObject;

public class EmployeeController extends BaseController {
	@Inject
	EmployeeService employeeService;
	
	@Inject
	OrganizationService orgService;
	
	@Inject
	UserService userService;
	
	public void index() {
		keepPara();
		int pageNum = getParaToInt("pageNum",1);
		int pageSize = getParaToInt("numPerPage",50);
		Page<Employee> page = employeeService.paginate(pageNum,pageSize,getConditions());
		setAttr("page",page);
		render("index.html");
	}
	
	public void add(){
		render("add.html");
	}
	
	public void create(Merchant merchant,Employee employee,User user){
		renderJson(AjaxObject.newOk("成功成功"));
	}
}
